package model

import "gorm.io/gorm"

type Text struct {
	gorm.Model
	Title     string `gorm:"type:varchar(50);not null;" json:"title"`
	Content   string `gorm:"type:text;not null;" json:"content"`
	LikeCount int    `gorm:"type:int;not null;default:0" json:"like_count"`
	LookLog   int    `gorm:"type:int;not null;default:0" json:"look_log"`
	ReviewNum int    `gorm:"type:int;not null;default:0" json:"review_num"`
	Review    []Review
}

type Review struct {
	gorm.Model
	TextId    int    `gorm:"int;not null;" json:"text_id"`
	FatherId  int    `gorm:"int;not null;default:0;" json:"father_id"`
	Context   string `gorm:"type:varchar(200);not null;" json:"context"`
	LikeCount int    `gorm:"type:int;not null;default:0;" json:"like_count"`
}
